package com.ruoyi.system.domain.Forest.second;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class DeviceDataResult {

    /**
     * 小区名称
     */
    private String villageName;
    /**
     * 楼栋名称
     */
    private String buildingName;
    /**
     * 小区编号
     */
    private String villageNo;
    /**
     * 楼栋编号
     */
    private String buildingNo;
    /**
     * 编号
     */
    private String roomNo;
    /**
     * 单元
     */
    private String unitName;
    /**
     * 门牌号
     */
    private String roomName;
    /**
     * 累计热量(KWH)
     */
    private Double heatQuantity;

    /**
     * 累计热量单位
     */
    private String heatQuantityUnit;

    /**
     * 累计冷量
     */
    private Double coldQuantity;

    /**
     * 累计冷量单位
     */
    private String coldQuantityUnit;
    /**
     * 累计流量(m^3)
     */
    private Double volume;

    /**
     * 累计流量单位
     */
    private String volumeUnit;
    /**
     * 热功率(KW)
     */
    private Double heatPower;

    /**
     * 热功率单位
     */
    private String heatPowerUnit;

    /**
     * 瞬时热量(m3/h)
     */
    private Double flowrate;

    /**
     * 流速
     */
    private Double flowrateReal;

    /**
     * 瞬时热量单位
     */
    private String flowrateUnit;
    /**
     * 进水温度(℃)
     */
    private Double tempIntake;
    /**
     * 回水温度(℃)
     */
    private Double tempReturn;

    /**
     * 累计工作时间, 单位：小时
     */
    private Integer hoursOperating;
    /**
     * 温差(℃)
     */
    private Double tempDiff;
    /**
     * 采样时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date timeSample;
    /**
     * 上传时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date timeUpload;
    /**
     *  热表状态
     */
    private Integer state;
    /**
     * 集中器ID
     */
    private String cmrId;
    /**
     * 热表ID
     */
    private String heatMeterId;
    /**
     * 备注
     */
    private String notes;


    public void random(String heatMeterId){
        heatQuantity = Math.random() * 100;
        heatQuantityUnit = "kWh";
        coldQuantity = Math.random() * 100;
        coldQuantityUnit = "kWh";
        volume = Math.random() * 100;
        volumeUnit = "m3";
        heatPower = Math.random() * 100;
        heatPowerUnit = "kW";
        flowrate = Math.random() * 100;
        flowrateReal = Math.random() * 100;
        flowrateUnit = "m3/h";
        tempIntake = Math.random() * 100;
        tempReturn = Math.random() * 100;
        hoursOperating = (int) (Math.random() * 100);
        tempDiff = Math.random() * 100;
        timeUpload = new Date();
        timeSample = new Date();
        state = 1;
        this.heatMeterId = heatMeterId;
    }
}
